package com.copa.l2011;

/**
 * @author copa
 * @createDate 2022-12-23 11:18
 * @function 骚操作法
 */
public class Test2 {

    public int finalValueAfterOperations(String[] operations) {
        int result = 0;
        for (String operation : operations) {
            if ('+' == operation.charAt(1)) {
                result++;
                continue;
            }
            result--;
        }
        return result;
    }

    public static void main(String[] args) {
        String[] operations = new String[]{"X++","++X","--X","X--"};
        System.out.println(new Test2().finalValueAfterOperations(operations));
    }
}
